const app = getApp();
import {getDeptUserTime} from '../../service/config/index.js'
import {downTab} from '../../service/config/config.js'

Page({
 
  /**
   * 页面的初始数据
   */
  data: {
    list:[
      {userName:"张三",deptName:"000236",number:"20223625",dateTime:"2022-10-18"},
      {userName:"李四",deptName:"000236",number:"20223625",dateTime:"2022-10-18"}
    ]
  },
  infoShow: function () {
    var that = this;
    getDeptUserTime().then(res=>{
      if(res.code == 0){
        that.setData({
          list:res.data
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
    this.infoShow();
    
 
  },

  downExcel(){
    wx.setClipboardData({
      data: downTab,
      success: function(res) {
        console.log(res)
        wx.showToast({
          title: '下载地址已粘贴到剪贴板，请前往浏览器下载！',
          icon: 'none',
          duration: 2000,
        })
      }
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    const that = this;
    wx.downloadFile({
      url: that.data.shareImgSrc,
      success: function (res) {
        that.data.shareImgSrc = res.tempFilePath
      }, fail: function (res) {
      }
    })
  },
 
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
     
  },
 
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
     
  },
 
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
     
  },
 
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
     
  },
 
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
     
  }
})